package cn.com.adcc.resource;

import cn.com.adcc.bean.MessageBean;
import cn.com.adcc.bean.UploadTaskInfo;
import cn.com.adcc.utils.Utils;
import org.joda.time.DateTime;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
import javax.xml.bind.JAXBElement;

/**
 * Created by anzilu on 2015/10/14.
 */
@Path("/status")
public class UploadingStatusResource {

    @Context
    UriInfo uriInfo;
    @Context
    Request request;

    @GET
    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
    public MessageBean getStatus(){

//        UploadTaskInfo uploadTaskInfo1=new UploadTaskInfo();
//        uploadTaskInfo1.setFilePath("testfilepath1");
//        uploadTaskInfo1.setPercent(90);
//        uploadTaskInfo1.setFileSize(150000);
//        uploadTaskInfo1.setUploadedSize(100000);
//        UploadTaskInfo uploadTaskInfo2=new UploadTaskInfo();
//        uploadTaskInfo2.setFilePath("testfilepath2");
//        uploadTaskInfo2.setFileSize(200000);
//        uploadTaskInfo2.setPercent(80);
//        uploadTaskInfo2.setUploadedSize(150000);
//        Utils.messageBean.getUploadTaskInfoMap().put("testfilepath1",uploadTaskInfo1);
//        Utils.messageBean.getUploadTaskInfoMap().put("testfilepath2",uploadTaskInfo2);
        return  Utils.messageBean;
    }
}
